<script>
var $$ = function() { return document.getElementById(arguments[0]); }

document.write("<div id='playad' style='DISPLAY: none'>");
document.write("<iframe src='' width='100%' height='100%' scrolling='no' frameborder='0' id='bdbuffer'></iframe>");
document.write('</div>');
document.write('<div id="play_error"></div>');
if(window.ActiveXObject){
	document.write('<object classid="clsid:02E2D748-67F8-48B4-8AB4-0A085374BB99" width="100%" height="'+  window.parent.getheight() +'" id="BaiduPlayer" name="BaiduPlayer" onerror="play_error();" >');
	document.write('<param name="URL" value="'+ window.parent.geturl() +'">');
	document.write('<param name="NextWebPage" value="'+window.parent.getNextUrl()+'">');
	document.write('<param name="NextCacheUrl" value="'+window.parent.getNextUrl(true)+'">');
	document.write('<param name="Autoplay" value="1">');
	document.write('</object>');
}
else{
	document.write('<object id="BaiduPlayer" name="BaiduPlayer" type="application/player-activex" width="100%" height="100%" progid="Xbdyy.PlayCtrl.1" param_URL="'+window.parent.geturl()+'"param_NextCacheUrl="'+window.parent.getNextUrl(true)+'" param_LastWebPage="" param_NextWebPage="'+window.parent.getNextUrl()+'" param_OnPlay="onPlay" param_OnPause="onPause" param_OnFirstBufferingStart="onFirstBufferingStart" param_OnFirstBufferingEnd="onFirstBufferingEnd" param_OnPlayBufferingStart="onPlayBufferingStart" param_OnPlayBufferingEnd="onPlayBufferingEnd" param_OnComplete="onComplete" param_Autoplay="1"></object>');
}


function AdsStart(){
	$$('playad').style.display = 'block';
	if(BaiduPlayer.IsBuffing()){
		$$("playad").style.height = window.parent.getheight() -80;
		BaiduPlayer.height = 80;
	}else{
		$$("playad").style.height = window.parent.getheight() -60;
		BaiduPlayer.height = 60;
	}
}
function AdsEnd(){
	$$('playad').style.display = 'none';
	BaiduPlayer.height = window.parent.getheight() ;
}
function Status(){
	if(BaiduPlayer.IsPlaying()){
		AdsEnd();
	}else{
		AdsStart();
	}
}
function play_error(){
	document.getElementById('play_error').innerHTML="<iframe border='0' src='http://union.maccms.com/gg/baidu.html' marginWidth='0' frameSpacing='0' marginHeight='0' frameBorder='0' noResize scrolling='no' width='100%' height='100%' vspale='0' ></iframe>";
}
if(BaiduPlayer.URL != undefined){
	BaiduPlayer.style.display = 'block';
	setInterval("Status()", 1000);
}
else{
	play_error();
}
</script>